<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
	
	function urgentordertip(t)
	{
		var str = selectallpro();
		if(str !=false)
		{
			if(confirm("确认通过审核吗?"))
			{
				$.post("/factory/ajaxbutton", {"op": "saveurgentordertip","id":str,"t":t},
			  function(data){
				  	if(data.code==200)
					{
						window.location.href = "/factory/urgentorder";
					}
					
			   },"json");	
			}
				
		}
	}
	function saveurgentorder()
	{
		var memo = $("#urgentordermemo").val();
		if(memo=='')
		{
			alert("请填写理由！");
			return;	
		}
		var str = selectallpro();
		if(str !=false)
		{
		
				$.post("/factory/ajaxbutton", {"op": "saveurgentordertip","id":str,"t":2,"memo":memo},
			  function(data){
				  	if(data.code==200)
					{
						window.location.href = "/factory/urgentorder";
					}
					
			   },"json");	
			
		}
	}
	function urgentorder()
	{
		$("#urgentorder").modal('show');	
	}
	function searchl(orderby)
	{
		$("#orderby").val(orderby);
		$("#search").submit();
	}
	function ouputcsv()
	{
		var str = selectallpro();
		if(str !=false)
		{
			$("#if_csv").val(1);
			$("#csvlist").val(str);
			$("#search").attr("target","_thank");
			$("#search").submit();
		}
		
	}
</script>
<title>工厂订单列表</title>
<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/leftmenu.tpl'}}
<div class="centercontent">
<div class="pageheader notab">
  <h1 class="pagetitle">优先处理订单列表</h1>
  <span class="pagedesc"></span>
  <div class="menulist">
  
  </div>
  
</div>
<!--pageheader-->
<div id="contentwrapper" class="contentwrapper">
<div id="basicform" class="subcontent">
   <!--搜索栏-->
          <div>
          
   		<div style="float:left">
     
       
          
          	<a href="javascript:void(0)" onClick="urgentordertip(1)" class="stdbtn btn_red"><span>通过审核</span></a>
            <a href="javascript:void(0)" onClick="urgentorder()" class="stdbtn btn_red"><span>不通过审核</span></a>
          
          
          
         </div>
         <div style="clear: both"></div>
         <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
   </div>
      
    <form class="stdform stdform2" method="get" id="search" action="/factory/orderlist">
    <input type='hidden' name='if_csv' id='if_csv'>
    <input type='hidden' name='csvlist' id='csvlist'>
    <input type='hidden' name='orderby' id='orderby'>

      <div class="tableoptions"> 
        <select name="shopname" id="shopname"  class="selection select2_group" style="width:150px;" >
        <option value="" >店铺</option>
        {{foreach from=$d_shop item=li key=key}}
              <option value="{{$li.name}}" {{if $shopname==$li.name}} selected{{/if}}>{{$li.name}}</option>
        {{/foreach}}
        </select>
        <select name="fID" id="fID"  class="selection " style="width:100px;" >
        <option value="" >工厂</option>
        {{foreach from=$factorylist item=li key=key}}
			<option value="{{$li.id}}" {{if $li.id==$fID}} selected{{/if}}>{{$li.name}}</option>
        {{/foreach}}
        </select>
          <select name="st" id="searchtype" class="selection " style="width:100px;" >
          <option value="" >订单状态</option>
        <option value="1" {{if $status==1}} selected{{/if}}>新订单</option>
        <option value="2" {{if $status==2}} selected{{/if}}>生产中</option>
        <option value="3" {{if $status==3}} selected{{/if}}>生产完成</option>
        <option value="4" {{if $status==4}} selected{{/if}}>已发货</option>
        <option value="5" {{if $status==5}} selected{{/if}}>作废单</option>
        <option value="6" {{if $status==6}} selected{{/if}}>禁止发货</option>
        <option value="7" {{if $status==7}} selected{{/if}}>加急单</option>
        <option value="8" {{if $status==8}} selected{{/if}}>未派单</option>
      </select>        
               
       <select name="ty" id="searchtype" class="selection" style="width:100px;" >
        <option value="1" {{if $ty==1}} selected{{/if}}>订单时间</option>
        <option value="2" {{if $ty==2}} selected{{/if}}>交货时间</option>
        <option value="3" {{if $ty==3}} selected{{/if}}>发货时间</option>
        <option value="4" {{if $ty==4}} selected{{/if}}>完成时间</option>
      </select>
    
       <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
       订单号: <input type="text" name="other" id="other" class="width200" value="{{$other}}" placeholder="订单编号" />
       交易号： <input type="text" name="tradeid" id="tradeid" class="width100" value="{{$tradeid}}" placeholder="交易号" />
       SKU: <input type="text" name="kw" id="kw" class="width100" value="{{$goodsku}}" placeholder="商品编号" />
       &nbsp;
      生产工人:
                          <select class="selectCss2" name="wk" id="wk">
                    <option value="">请选择</option>
                    {{foreach from=$workers item=res key=key}}
                    <option value="{{$res.id}}" {{if $wk==$res.id}} selected{{/if}}> {{$res.name}} </option>
                    {{/foreach}}
                  </select>
          &nbsp;
      裁剪:
                          <select class="selectCss2" name="cj" id="cj">
                    <option value="">请选择</option>
                    {{foreach from=$caijian item=res key=key}}
                    <option value="{{$res.id}}" {{if $cj==$res.id}} selected{{/if}}> {{$res.name}} </option>
                    {{/foreach}}
                  </select>
                           
&nbsp;
		  买家账号: <input type="text" name="customerId" id="other" class="width100" value="{{$customerId}}" placeholder="买家账号" />
        <button class="btn btn-primary" id="searchbtn">Search</button>
     &nbsp;
      </div>
      
    
    </form>
    <!--搜索栏结束-->
    <div class="x_content" style="overflow-x:auto;">
<table cellpadding="0" cellspacing="0" border="0" class="stdtable" >
<thead>
  <tr class="lbbt">
    <td width="5%" bgcolor="#FEFFF1"><a onClick="allSelect('ppid[]')">全选</a></td>
    <td width="10%" bgcolor="#FEFFF1">订单编号</td>
    <td width="5%" bgcolor="#FEFFF1">状态</td>
    <td width="18%" bgcolor="#FEFFF1">商品名称</td>
    <td width="12%" bgcolor="#FEFFF1">交易号</td>
    <td width="15%" bgcolor="#FEFFF1">平台/店铺/负责人</td>
    <td width="5%" bgcolor="#FEFFF1">生产工厂</td>
    <td width="8%" bgcolor="#FEFFF1" ><a href="javascript:void(0)" onClick="searchl({{$orderbyst}})">订单</a>/交货日期</td>
    <td width="9%" bgcolor="#FEFFF1">优先处理理由</td>
    <td width="14%"bgcolor="#FEFFF1" >客户ID/国家</td>

    
  </tr>
</thead>
<tbody >

{{foreach from=$orderlist item=li key=key}}
  <tr>
    <td bgcolor="#FFFFFF"><input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.orderId}}" />{{if $li.printflag==1}}<img src="/fuman/images/print.png" title="已打印">{{/if}}{{if $li.descr}}<a ><img src="/fuman/images/bj.jpg" title="备注信息"><span id="tip_info">{{$li.descr}}</span></a>{{/if}}</td>
    <td valign="middle" bgcolor="#FFFFFF" style="position:relative;">
     <a href="/factory/orderdetail?id={{$li.id}}" target="_blank"><font color="#6666FF">{{$li.orderId}}</font></a>
     </td>
    <td valign="middle" bgcolor="#FFFFFF">{{if $li.updateflag==9}}{{$li.statustext}}{{else}}<font color=red>{{$li.statustext}}</font>{{/if}}
   
    {{if $li.orderurgent==17 && $li.orderurgenttip==1}}<br><font color="#FF0000">优先处理</font>{{/if}}
     {{if $li.orderurgent==17 && $li.orderurgenttip==0}}<br>等待审核{{/if}}
    
    </td>
    <td height="58" bgcolor="#FFFFFF" style="position:relative;">
    <div style=" float:left; border:1px solid #CCC; margin-right:10px;">
    	{{if $li.local_url}}<a href="/{{$li.local_url}}" target="_blank"> <img src="{{$li.thumb_url}}" height="50"></a>{{else}} <img src="{{$li.thumb_url}}" height="50">{{/if}}</div>
      <div style="margin-left:10px;">  {{$li.skuName}}<br>
     	<a href="/factory/orderdetail?id={{$li.id}}"><font color="#6666FF">{{$li.goods_sku}}</font></a>
       <!--<br>{{$li.mabangorderid}}-->
    </div>
     
      <div class="lbcp">
      </div>
   </td>
    <td valign="middle" bgcolor="#FFFFFF">{{$li.dealid}}</td>
    <td valign="middle" bgcolor="#FFFFFF">{{$li.shopId}}<br>{{$li.platformId}}<br>{{$li.responsible}}</td>
    <td bgcolor="#FFFFFF" class="cz">{{$li.factoryl}}</td>
    <td bgcolor="#FFFFFF" class="cz">{{$li.orderTime}}<br>{{$li.deliveryTime}}</td>
    <td bgcolor="#FFFFFF" class="cz">
    {{$li.nature}}
   </td>
    <td bgcolor="#FFFFFF" class="cz">{{$li.customerId}}<br>{{$li.country}}&nbsp;&nbsp;
     {{if $managers || $userdepartment==3}}
     	{{if $li.isform==0}}
    <a href="http://192.168.1.88:90/eshop/order.do?method=edit&orderid={{$li.mabangorderid}}" target="_blank"><img src="/fuman/images/icons/attachment.png"><span id="tip_info">马帮订单</span></a>
    	{{else}}
        <a href="/orderlist/editorder?sn={{$li.mabangorderid}}" target="_blank"><img src="/fuman/images/icons/attachment.png"><span id="tip_info">订单详细</span></a>
        {{/if}}
    {{/if}}
    </td>
   
  </tr>
   
{{/foreach}}
</tbody>

</table>
</div>
  <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
</div>
</div>

  

<!--优先处理的订单标识-->
  <form  method="post">
  <div class="modal fade" id="urgentorder" tabindex="-1" role="dialog" aria-labelledby="surgentorder" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="surgentorder"> 优先处理订单不通过理由  </h4>
        </div>
        <div class="modal-body">
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="100">优先处理订单不通过理由 </td>
              <td align="left">
              
           <!--<select name="urgentordermemo" id="urgentordermemo" class="selection " style="width:100px;" >
          <option value="" >请选择</option>
        <option value="赶节日前送达" {{if $status=='赶节日前送达'}} selected{{/if}}>赶节日前送达</option>
        <option value="订单已经一个月以上了" {{if $status=='订单已经一个月以上了'}} selected{{/if}}>订单已经一个月以上了</option>
       
      </select>   -->     
      
      <textarea name="urgentordermemo" id="urgentordermemo" cols="10" rows="10"></textarea>
              
            </tr>
            
          
          <tbody id="showmabangid"></tbody>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="saveurgentorder()"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
  <!-- /.modal -->
  </form>
  <!--结束-->
  

  
  
</body>
</html>